#common makefile header

DIR_INC = ../../include
DIR_LIB = /usr/local/lib/xftts

BIN_TARGET = libxtts.so

CROSS_COMPILE = 
CFLAGS = -g -Wall -fPIC -I$(DIR_INC)

ifdef LINUX64
LDFLAGS := -L$(DIR_LIB)
else
LDFLAGS := -L$(DIR_LIB)
endif
LDFLAGS += -shared
LDFLAGS += -Wl,-rpath=/usr/local/lib/xftts
LDFLAGS += -lmsc -lrt -ldl -lpthread -lstdc++

OBJECTS := $(patsubst %.c,%.o,$(wildcard *.c))

$(BIN_TARGET) : $(OBJECTS)
	$(CROSS_COMPILE)gcc $(CFLAGS) $^ -o $@ $(LDFLAGS)

%.o : %.c
	$(CROSS_COMPILE)gcc -c $(CFLAGS) $< -o $@

clean:
	@rm -f *.o $(BIN_TARGET)

.PHONY:clean

#common makefile foot
